package office.action.system.vo;

import platform.util.DateUtil;

public class DepartmentVo {
	
	private String parentId;
	
	private String id;
	
	private String name;
	
	private String memo;
	
	private String createDate = DateUtil.getCurrentDate();
	
	private String type;
	
	private String companyId;
	
	private String companyName;
	
	private int treeLevel;
	
	private int paddingLeft;//页面要缩进的像素
	
	private int  ONEPADDINGLEFT=18;//一个level多对应的像素
	
	private int leftValue;//节点的左值，需要赋值，计算leaf用
	
	private int rightValue;//节点的右值，需要赋值，计算leaf用
	
	@SuppressWarnings("unused")
	private boolean leaf;//是否是叶子节点 true是叶子节点
	
	@SuppressWarnings("unused")
	private String tempName;
	

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	

	public int getTreeLevel() {
		return treeLevel;
	}

	public void setTreeLevel(int treeLevel) {
		this.treeLevel = treeLevel;
	}

	public int getLeftValue() {
		return leftValue;
	}

	public void setLeftValue(int leftValue) {
		this.leftValue = leftValue;
	}

	public int getRightValue() {
		return rightValue;
	}

	public void setRightValue(int rightValue) {
		this.rightValue = rightValue;
	}

	public int getPaddingLeft() {
		paddingLeft=this.getTreeLevel()*ONEPADDINGLEFT;
		if(isLeaf()){
			paddingLeft=paddingLeft+2;//页面调试时需要加2个像素
		}
		return paddingLeft;
	}

	public void setPaddingLeft(int paddingLeft) {
		this.paddingLeft = paddingLeft;
	}

	public boolean isLeaf() {
		if(this.rightValue-this.leftValue==1){
			return true;
		}else{
			return false;
		}
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public String getTempName() {
		String temp = "";
		for(int i=0;i<this.getTreeLevel();i++){
			temp = temp+"••";
		}
		return temp+this.getName();
	}

	public void setTempName(String tempName) {
		this.tempName = tempName;
	}
	
}
